package com.interview.ujiuye4;

import java.util.ArrayList;
import java.util.List;

/**
 * Copyright (C), 2018-2020
 * FileName: Demo3
 * Author:   kongfanyu
 * Date:     2020/10/17 14:05
 */
public class Demo3 {
    public static void main(String[] args) {
        String str = "";
        System.out.println(str == "");
        System.out.println(str.equals(""));
        System.out.println(str.length() == 0);
        System.out.println(str == null);
        System.out.println("==================");
        List<Integer> list1 = null;
        List<String> list = new ArrayList<>();
        System.out.println(list.isEmpty());
        System.out.println(list.size()==0);
        System.out.println(list == null);

        list.add("迪丽热巴1");
        list.add("迪丽热巴2");
        list.add("迪丽热巴3");
        list.add("迪丽热巴4");
        list.add("迪丽热巴5");
        list.add("迪丽热巴6");
        list.forEach( item -> {
            System.out.println(item);
        } );
        list.forEach(System.out::println);
    }
}
